//
//  ZH_WalletTableViewCell.m
//  WisdomStar
//
//  Created by zhangliwen on 2018/10/23.
//  Copyright © 2018年 zhangliwen. All rights reserved.
//

#import "ZH_WalletTableViewCell.h"
@interface ZH_WalletTableViewCell()
@property (nonatomic,weak)UILabel *leftLabel;
@property (nonatomic,weak)UILabel *rightLabel;
@end
@implementation ZH_WalletTableViewCell

///创建
+(instancetype)cellWithTableView:(UITableView*)tableView
{
    static NSString *ID = @"ZH_WalletTableViewCell";
    ZH_WalletTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if(cell == nil){
        cell = [[ZH_WalletTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
    }
    return cell;
}
///初始化
-(void)initDefault
{
    [self unShowClickEffect];
    self.bottomShortLineImage.hidden = NO;
}
- (void)loadSubviewConstraints{
    [self.leftLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).offset(FITSCALE(20));
        make.centerY.equalTo(self.contentView);
    }];
    [self.rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView).offset(FITSCALE(-20));
        make.centerY.equalTo(self.contentView);
    }];
}
- (void)setLeftString:(NSString *)leftString{
    self.leftLabel.text = leftString;
}
- (void)leftLabelColor{
    self.leftLabel.textColor = [UIColor colorWithHexString:@"#00C9AE"];
}
#pragma mark - getter,setter
- (UILabel *)leftLabel{
    if (!_leftLabel) {
        UILabel *label = [UILabel createLabelWithText:@"" font:kFontSize_28];
        [self.contentView addSubview:_leftLabel = label];
    }
    return _leftLabel;
}
- (UILabel *)rightLabel{
    if (!_rightLabel) {
        UILabel *label = [UILabel createLabelWithText:@"￥0.00" font:kFontSize_28];
        label.textColor = [UIColor colorWithHexString:@"#FF4646"];
        label.textAlignment = NSTextAlignmentRight;
        [self.contentView addSubview:_rightLabel = label];
    }
    return _rightLabel;
}
@end
